import request from '@/utils/request'

// 分页
export function page(data) {
  return request({
    url: '/system/role/page',
    method: 'post',
    data
  })
}

// 查询
export function get(params) {
  return request({
    url: `/system/role`,
    method: 'get',
    params
  })
}

// 新增
export function add(data) {
  return request({
    url: `/system/role`,
    method: 'post',
    data
  })
}

// 修改
export function edit(data) {
  return request({
    url: `/system/role`,
    method: 'put',
    data
  })
}

// 删除
export function remove(data) {
  return request({
    url: `/system/role`,
    method: 'delete',
    data
  })
}

export function authList(data) {
  return request({
    url: `/system/role/authList`,
    method: 'post',
    data
  })
}

export function auth(data) {
  return request({
    url: `/system/role/auth`,
    method: 'put',
    data
  })
}

export function getResource(data) {
  return request({
    url: `/system/role/get/resource`,
    method: 'post',
    data
  })
}

export function resource(data) {
  return request({
    url: `/system/role/resource`,
    method: 'put',
    data
  })
}
